package com.arpa.wms.service;

import com.arpa.wms.domain.dto.CountingSupplementRegisterDTO;
import com.arpa.wms.domain.dto.WmsCountingTaskDTO;
import com.arpa.wms.domain.entity.Counting;
import com.arpa.wms.domain.entity.CountingRegister;
import com.arpa.wms.domain.vo.CountingItemVO;
import com.arpa.wms.domain.vo.CountingSupplementGoodsVO;
import com.arpa.wms.domain.vo.CountingTaskDetailPageVO;
import org.springframework.transaction.annotation.Transactional;

import java.math.BigDecimal;
import java.util.List;


/**
 * @author: Allen chen
 * @Date 2020/10/22
 * @Description:
 */
public interface IWmsCountingTaskService {

    /**
     * PDA盘点任务详细信息
     *
     * @param wmsCountingTaskDTO
     * @return
     */
    CountingTaskDetailPageVO taskDetail(WmsCountingTaskDTO wmsCountingTaskDTO);

    /**
     * @author: Allen chen
     * @Date: 2020/10/23 15:38
     * @Description:PDA盘点登记
     */
    CountingItemVO toRegister(WmsCountingTaskDTO wmsCountingTaskDTO);

    /**
     * PDA盘点登记确认
     * @param vo 盘点登记信息
     * @return
     */
    boolean confirm(CountingRegister vo);

    /**
     * 盘点登记确认后，检查更新任务状态及作业数量
     * @param taskCode 任务号
     * @param jobQuantity 作业数量
     * @return
     */
    @Transactional(rollbackFor = Exception.class)
    boolean updateTask(String taskCode, BigDecimal jobQuantity);

    /**
     * PAD收货登记后判断当前任务所有的盘点是否都完成
     * @param countingCode 盘点单号
     * @param taskCode 任务号
     */
    void checkConfirm(String countingCode, String taskCode);

    /**
     * PDA盘点商品补登
     * @param countingSupplementRegister 商品补登信息
     * @return true 补登成功，false 补登失败
     */
    boolean supplement(CountingSupplementRegisterDTO countingSupplementRegister);

    /**
     * 商品补登扫描条码商品信息
     * @param taskCode 盘点任务号
     * @param countingCode 盘点单号
     * @param barCode 商品条码
     * @param warehouseCode 仓库标识
     * @return
     */
    List<CountingSupplementGoodsVO> supplementScan(String taskCode,String countingCode,String barCode,String warehouseCode,String shipmentCode);
}
